<?php
namespace app\api\controller;


use think\Db;

class UserPt extends Base
{
  public function group_lists(){
      $user_id=$this->getuser();
      $page=i("page","请输入页码","int");
      $status=i("status","请输入拼团状态");

      $pt_group_lists=Db::table("pt_order_group_view")->where("user_id",$user_id)->where("status",$status)->limit(($page-1)*10,10)->order("order_time desc")->select();

      $lists=model("ptActivity")->where("isdelete",0)->order("sort asc")->select();
      for($i=0;$i<count($lists);$i++){
          $lists[$i]['goods']=model("goods")->where("id",$lists[$i]['goods_id'])->find();
          $lists[$i]['pt_price']=(intval($lists[$i]['goods']['price']*100)-intval($lists[$i]['discount']*100))/100;
      }
      return s($pt_group_lists);
  }


}
